using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using TVSGPP.bookGPP;
namespace SS
{
	public class frmBookProduct : Form
	{
		private IContainer components = null;
		private TextBox txtreTailPrice;
		private Label label9;
		private TextBox txtSalePrice;
		private Label label8;
		private TextBox txtInputPrice;
		private Label label7;
		private Button tSBClose;
		private Button tSBSave;
		private Button tSBAdd;
		private Button btnDel;
		private DataGridView dgvRep;
		private ComboBox cbbList;
		private TextBox txtSearch;
		private Label label2;
		private Button btnShowAll;
		private ImageList imageList1;
		private ToolTip toolTip1;
		private BindingNavigator bindingNavigator1;
		private ToolStripLabel bindingNavigatorCountItem;
		private ToolStripButton bindingNavigatorMoveFirstItem;
		private ToolStripButton bindingNavigatorMovePreviousItem;
		private ToolStripSeparator bindingNavigatorSeparator;
		private ToolStripTextBox bindingNavigatorPositionItem;
		private ToolStripSeparator bindingNavigatorSeparator1;
		private ToolStripButton bindingNavigatorMoveNextItem;
		private ToolStripButton bindingNavigatorMoveLastItem;
		private ToolStripSeparator bindingNavigatorSeparator2;
		private Label lblSpace;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
		private Button button1;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
		private DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;
		private Label label1;
		private DataGridViewTextBoxColumn GpID;
		private DataGridViewTextBoxColumn GroupName;
		private DataGridViewTextBoxColumn dg2;
		private DataGridViewTextBoxColumn Column1;
		private DataGridViewTextBoxColumn Agent1;
		private DataGridViewTextBoxColumn Agent2;
		private DataGridViewTextBoxColumn Agent3;
		private DataGridViewTextBoxColumn RootPrice;
		private DataGridViewTextBoxColumn Discount;
		private DataGridViewTextBoxColumn DiscountPrice;
		private DataGridViewTextBoxColumn dg3;
		private DataGridViewTextBoxColumn dg4;
		private DataGridViewTextBoxColumn dg5;
		private DataGridViewTextBoxColumn dg6;
		private DataGridViewTextBoxColumn Column2;
		private DataGridViewTextBoxColumn Column3;
		private Func objFunc = new Func();
		public int ProductID = 0;
		private int currGroup = 0;
		private clsProductExt objP = new clsProductExt();
		private bool loaded = false;
		public bool checkChange = false;
		public bool fastAdd = false;
		public string NameOfNewProduct = "";
		private DataTable objTable = new DataTable();
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			DataGridViewCellStyle dataGridViewCellStyle = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle2 = new DataGridViewCellStyle();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmBookProduct));
			DataGridViewCellStyle dataGridViewCellStyle3 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle4 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle5 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle6 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle7 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle8 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle9 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle10 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle11 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle12 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle13 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle14 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle15 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle16 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle17 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle18 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle19 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle20 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle21 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle22 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle23 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle24 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle25 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle26 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle27 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle28 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle29 = new DataGridViewCellStyle();
			DataGridViewCellStyle dataGridViewCellStyle30 = new DataGridViewCellStyle();
			this.txtreTailPrice = new TextBox();
			this.label9 = new Label();
			this.txtSalePrice = new TextBox();
			this.label8 = new Label();
			this.txtInputPrice = new TextBox();
			this.label7 = new Label();
			this.tSBClose = new Button();
			this.tSBSave = new Button();
			this.tSBAdd = new Button();
			this.btnDel = new Button();
			this.dgvRep = new DataGridView();
			this.cbbList = new ComboBox();
			this.txtSearch = new TextBox();
			this.label2 = new Label();
			this.btnShowAll = new Button();
			this.imageList1 = new ImageList(this.components);
			this.toolTip1 = new ToolTip(this.components);
			this.bindingNavigator1 = new BindingNavigator(this.components);
			this.bindingNavigatorCountItem = new ToolStripLabel();
			this.bindingNavigatorMoveFirstItem = new ToolStripButton();
			this.bindingNavigatorMovePreviousItem = new ToolStripButton();
			this.bindingNavigatorSeparator = new ToolStripSeparator();
			this.bindingNavigatorPositionItem = new ToolStripTextBox();
			this.bindingNavigatorSeparator1 = new ToolStripSeparator();
			this.bindingNavigatorMoveNextItem = new ToolStripButton();
			this.bindingNavigatorMoveLastItem = new ToolStripButton();
			this.bindingNavigatorSeparator2 = new ToolStripSeparator();
			this.lblSpace = new Label();
			this.button1 = new Button();
			this.label1 = new Label();
			this.dataGridViewTextBoxColumn1 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn2 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn3 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn4 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn5 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn6 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn7 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn8 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn9 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn10 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn11 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn12 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn13 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn14 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn15 = new DataGridViewTextBoxColumn();
			this.dataGridViewTextBoxColumn16 = new DataGridViewTextBoxColumn();
			this.GpID = new DataGridViewTextBoxColumn();
			this.GroupName = new DataGridViewTextBoxColumn();
			this.dg2 = new DataGridViewTextBoxColumn();
			this.Column1 = new DataGridViewTextBoxColumn();
			this.Agent1 = new DataGridViewTextBoxColumn();
			this.Agent2 = new DataGridViewTextBoxColumn();
			this.Agent3 = new DataGridViewTextBoxColumn();
			this.RootPrice = new DataGridViewTextBoxColumn();
			this.Discount = new DataGridViewTextBoxColumn();
			this.DiscountPrice = new DataGridViewTextBoxColumn();
			this.dg3 = new DataGridViewTextBoxColumn();
			this.dg4 = new DataGridViewTextBoxColumn();
			this.dg5 = new DataGridViewTextBoxColumn();
			this.dg6 = new DataGridViewTextBoxColumn();
			this.Column2 = new DataGridViewTextBoxColumn();
			this.Column3 = new DataGridViewTextBoxColumn();
			((ISupportInitialize)this.dgvRep).BeginInit();
			((ISupportInitialize)this.bindingNavigator1).BeginInit();
			this.bindingNavigator1.SuspendLayout();
			base.SuspendLayout();
			this.txtreTailPrice.BackColor = Color.White;
			this.txtreTailPrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtreTailPrice.Location = new Point(511, 317);
			this.txtreTailPrice.Name = "txtreTailPrice";
			this.txtreTailPrice.Size = new Size(96, 22);
			this.txtreTailPrice.TabIndex = 7;
			this.txtreTailPrice.Text = "0";
			this.txtreTailPrice.TextAlign = HorizontalAlignment.Right;
			this.txtreTailPrice.KeyPress += new KeyPressEventHandler(this.txtreTailPrice_KeyPress);
			this.label9.AutoSize = true;
			this.label9.Location = new Point(439, 320);
			this.label9.Name = "label9";
			this.label9.Size = new Size(69, 15);
			this.label9.TabIndex = 14;
			this.label9.Text = "Giá bán lẻ :";
			this.txtSalePrice.BackColor = Color.White;
			this.txtSalePrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtSalePrice.Location = new Point(300, 317);
			this.txtSalePrice.Name = "txtSalePrice";
			this.txtSalePrice.Size = new Size(96, 22);
			this.txtSalePrice.TabIndex = 6;
			this.txtSalePrice.Text = "0";
			this.txtSalePrice.TextAlign = HorizontalAlignment.Right;
			this.txtSalePrice.KeyPress += new KeyPressEventHandler(this.txtSalePrice_KeyPress);
			this.label8.AutoSize = true;
			this.label8.Location = new Point(210, 320);
			this.label8.Name = "label8";
			this.label8.Size = new Size(87, 15);
			this.label8.TabIndex = 12;
			this.label8.Text = "Giá bán buôn :";
			this.txtInputPrice.BackColor = Color.White;
			this.txtInputPrice.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.txtInputPrice.Location = new Point(284, 317);
			this.txtInputPrice.Name = "txtInputPrice";
			this.txtInputPrice.Size = new Size(108, 22);
			this.txtInputPrice.TabIndex = 5;
			this.txtInputPrice.Text = "0";
			this.txtInputPrice.TextAlign = HorizontalAlignment.Right;
			this.txtInputPrice.KeyPress += new KeyPressEventHandler(this.txtInputPrice_KeyPress);
			this.label7.AutoSize = true;
			this.label7.Location = new Point(218, 320);
			this.label7.Name = "label7";
			this.label7.Size = new Size(63, 15);
			this.label7.TabIndex = 10;
			this.label7.Text = "Giá nhập :";
			this.tSBClose.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.tSBClose.BackColor = SystemColors.ControlLight;
			this.tSBClose.Cursor = Cursors.Hand;
			this.tSBClose.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.tSBClose.FlatStyle = FlatStyle.Flat;
			this.tSBClose.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBClose.ImageAlign = ContentAlignment.MiddleLeft;
//			this.tSBClose.ImeMode = ImeMode.NoControl;
			this.tSBClose.Location = new Point(794, 565);
			this.tSBClose.Name = "tSBClose";
			this.tSBClose.Size = new Size(100, 30);
			this.tSBClose.TabIndex = 27;
			this.tSBClose.Text = "Thoát  [ ESC ]";
			this.tSBClose.UseVisualStyleBackColor = false;
			this.tSBClose.Click += new EventHandler(this.tSBClose_Click);
			this.tSBSave.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.tSBSave.BackColor = SystemColors.ControlLight;
			this.tSBSave.Cursor = Cursors.Hand;
			this.tSBSave.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.tSBSave.FlatStyle = FlatStyle.Flat;
			this.tSBSave.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBSave.ImageAlign = ContentAlignment.MiddleLeft;
//			this.tSBSave.ImeMode = ImeMode.NoControl;
			this.tSBSave.Location = new Point(113, 565);
			this.tSBSave.Name = "tSBSave";
			this.tSBSave.Size = new Size(105, 30);
			this.tSBSave.TabIndex = 25;
			this.tSBSave.Text = "Cập nhật [ F5 ]";
			this.tSBSave.UseVisualStyleBackColor = false;
			this.tSBSave.Click += new EventHandler(this.tSBSave_Click);
			this.tSBSave.KeyPress += new KeyPressEventHandler(this.tSBSave_KeyPress);
			this.tSBAdd.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.tSBAdd.BackColor = SystemColors.ControlLight;
			this.tSBAdd.Cursor = Cursors.Hand;
			this.tSBAdd.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.tSBAdd.FlatStyle = FlatStyle.Flat;
			this.tSBAdd.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.tSBAdd.ImageAlign = ContentAlignment.MiddleLeft;
//			//this.tSBAdd.ImeMode = ImeMode.NoControl;
			this.tSBAdd.Location = new Point(5, 565);
			this.tSBAdd.Name = "tSBAdd";
			this.tSBAdd.Size = new Size(105, 30);
			this.tSBAdd.TabIndex = 24;
			this.tSBAdd.Text = "Đồng bộ [ F4 ]";
			this.tSBAdd.UseVisualStyleBackColor = false;
			this.tSBAdd.Click += new EventHandler(this.tSBAdd_Click);
			this.btnDel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnDel.BackColor = SystemColors.ControlLight;
			this.btnDel.Cursor = Cursors.Hand;
			this.btnDel.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnDel.FlatStyle = FlatStyle.Flat;
			this.btnDel.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnDel.ImageAlign = ContentAlignment.MiddleLeft;
			this.btnDel.Location = new Point(221, 565);
			this.btnDel.Name = "btnDel";
			this.btnDel.Size = new Size(105, 30);
			this.btnDel.TabIndex = 26;
			this.btnDel.Text = "Ghi nhận [ F6 ]";
			this.btnDel.UseVisualStyleBackColor = false;
			this.btnDel.Click += new EventHandler(this.btnDel_Click);
			this.dgvRep.AllowUserToAddRows = false;
			this.dgvRep.AllowUserToDeleteRows = false;
			this.dgvRep.AllowUserToResizeColumns = false;
			this.dgvRep.AllowUserToResizeRows = false;
			dataGridViewCellStyle.BackColor = Color.White;
			dataGridViewCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle;
			this.dgvRep.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.dgvRep.BackgroundColor = Color.White;
			this.dgvRep.BorderStyle = BorderStyle.Fixed3D;
			this.dgvRep.ColumnHeadersHeight = 24;
			this.dgvRep.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
			this.dgvRep.Columns.AddRange(new DataGridViewColumn[]
			{
				this.GpID,
				this.GroupName,
				this.dg2,
				this.Column1,
				this.Agent1,
				this.Agent2,
				this.Agent3,
				this.RootPrice,
				this.Discount,
				this.DiscountPrice,
				this.dg3,
				this.dg4,
				this.dg5,
				this.dg6,
				this.Column2,
				this.Column3
			});
			this.dgvRep.Cursor = Cursors.Hand;
			this.dgvRep.EnableHeadersVisualStyles = false;
			this.dgvRep.Location = new Point(5, 46);
			this.dgvRep.Name = "dgvRep";
			this.dgvRep.ReadOnly = true;
			this.dgvRep.RowHeadersVisible = false;
			this.dgvRep.RowHeadersWidth = 26;
			this.dgvRep.RowHeadersWidthSizeMode = DataGridViewRowHeadersWidthSizeMode.DisableResizing;
			dataGridViewCellStyle2.BackColor = Color.White;
			dataGridViewCellStyle2.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.dgvRep.RowsDefaultCellStyle = dataGridViewCellStyle2;
			this.dgvRep.RowTemplate.DefaultCellStyle.BackColor = Color.White;
			this.dgvRep.RowTemplate.DefaultCellStyle.Font = new Font("Arial", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.dgvRep.SelectionMode = DataGridViewSelectionMode.CellSelect;
			this.dgvRep.Size = new Size(889, 485);
			this.dgvRep.TabIndex = 6;
			this.cbbList.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbList.Font = new Font("Arial", 12.75f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.cbbList.FormattingEnabled = true;
			this.cbbList.Items.AddRange(new object[]
			{
				"TẨT CẢ",
				"------ A",
				"------ B",
				"------ C",
				"------ D",
				"------ E",
				"------ F",
				"------ G",
				"------ H",
				"------ I",
				"------ J",
				"------ K",
				"------ L",
				"------ M",
				"------ N",
				"------ O",
				"------ P",
				"------ Q",
				"------ R",
				"------ S",
				"------ T",
				"------ U",
				"------ V",
				"------ W",
				"------ X",
				"------ Y",
				"------ Z"
			});
			this.cbbList.Location = new Point(5, 11);
			this.cbbList.Name = "cbbList";
			this.cbbList.Size = new Size(102, 27);
			this.cbbList.TabIndex = 0;
			this.cbbList.SelectedIndexChanged += new EventHandler(this.cbbList_SelectedIndexChanged);
			this.txtSearch.AcceptsReturn = true;
			this.txtSearch.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.txtSearch.Font = new Font("Arial", 11.25f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.txtSearch.Location = new Point(405, 13);
			this.txtSearch.Name = "txtSearch";
			this.txtSearch.Size = new Size(489, 25);
			this.txtSearch.TabIndex = 2;
			this.txtSearch.TextChanged += new EventHandler(this.txtSearch_TextChanged);
			this.txtSearch.Enter += new EventHandler(this.txtSearch_Enter);
			this.label2.AutoSize = true;
			this.label2.BackColor = Color.White;
			this.label2.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.label2.Location = new Point(259, 18);
			this.label2.Name = "label2";
			this.label2.Size = new Size(142, 15);
			this.label2.TabIndex = 127;
			this.label2.Text = "Tìm theo tên sản phẩm :";
			this.label2.TextAlign = ContentAlignment.MiddleRight;
			this.btnShowAll.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.btnShowAll.FlatStyle = FlatStyle.Flat;
			this.btnShowAll.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.btnShowAll.Location = new Point(113, 83);
			this.btnShowAll.Name = "btnShowAll";
			this.btnShowAll.Size = new Size(89, 28);
			this.btnShowAll.TabIndex = 1;
			this.btnShowAll.Text = "Xem tất cả";
			this.btnShowAll.UseVisualStyleBackColor = true;
			this.btnShowAll.Click += new EventHandler(this.btnShowAll_Click);
            //this.imageList1.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList1.ImageStream");
			this.imageList1.TransparentColor = Color.Transparent;
			this.imageList1.Images.SetKeyName(0, "star_2.png");
			this.imageList1.Images.SetKeyName(1, "31.png");
			this.toolTip1.IsBalloon = true;
			this.bindingNavigator1.AddNewItem = null;
			this.bindingNavigator1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.bindingNavigator1.AutoSize = false;
			this.bindingNavigator1.BackColor = SystemColors.ButtonFace;
			this.bindingNavigator1.CountItem = this.bindingNavigatorCountItem;
			this.bindingNavigator1.CountItemFormat = "/ {0}";
			this.bindingNavigator1.DeleteItem = null;
			this.bindingNavigator1.Dock = DockStyle.None;
			this.bindingNavigator1.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigator1.GripStyle = ToolStripGripStyle.Hidden;
			this.bindingNavigator1.Items.AddRange(new ToolStripItem[]
			{
				this.bindingNavigatorMoveFirstItem,
				this.bindingNavigatorMovePreviousItem,
				this.bindingNavigatorSeparator,
				this.bindingNavigatorPositionItem,
				this.bindingNavigatorCountItem,
				this.bindingNavigatorSeparator1,
				this.bindingNavigatorMoveNextItem,
				this.bindingNavigatorMoveLastItem,
				this.bindingNavigatorSeparator2
			});
			this.bindingNavigator1.Location = new Point(5, 534);
			this.bindingNavigator1.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
			this.bindingNavigator1.MoveLastItem = this.bindingNavigatorMoveLastItem;
			this.bindingNavigator1.MoveNextItem = this.bindingNavigatorMoveNextItem;
			this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
			this.bindingNavigator1.Name = "bindingNavigator1";
			this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem;
			this.bindingNavigator1.RenderMode = ToolStripRenderMode.Professional;
			this.bindingNavigator1.Size = new Size(889, 25);
			this.bindingNavigator1.TabIndex = 777;
			this.bindingNavigator1.Text = "bindingNavigator1";
			this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
			this.bindingNavigatorCountItem.Size = new Size(28, 22);
			this.bindingNavigatorCountItem.Text = "/ {0}";
			this.bindingNavigatorCountItem.ToolTipText = "Total number of items";
			this.bindingNavigatorMoveFirstItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveFirstItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveFirstItem.Image");
			this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
			this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveFirstItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveFirstItem.Text = "Move first";
			this.bindingNavigatorMovePreviousItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMovePreviousItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMovePreviousItem.Image");
			this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
			this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMovePreviousItem.Size = new Size(23, 22);
			this.bindingNavigatorMovePreviousItem.Text = "Move previous";
			this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
			this.bindingNavigatorSeparator.Size = new Size(6, 25);
			this.bindingNavigatorPositionItem.AccessibleName = "Position";
			this.bindingNavigatorPositionItem.AutoSize = false;
			this.bindingNavigatorPositionItem.BackColor = SystemColors.ButtonFace;
			this.bindingNavigatorPositionItem.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 163);
			this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
			this.bindingNavigatorPositionItem.Size = new Size(50, 21);
			this.bindingNavigatorPositionItem.Text = "0";
			this.bindingNavigatorPositionItem.TextBoxTextAlign = HorizontalAlignment.Center;
			this.bindingNavigatorPositionItem.ToolTipText = "Current position";
			this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
			this.bindingNavigatorSeparator1.Size = new Size(6, 25);
			this.bindingNavigatorMoveNextItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveNextItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveNextItem.Image");
			this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
			this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveNextItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveNextItem.Text = "Move next";
			this.bindingNavigatorMoveLastItem.DisplayStyle = ToolStripItemDisplayStyle.Image;
//			//this.bindingNavigatorMoveLastItem.Image = (Image)componentResourceManager.GetObject("bindingNavigatorMoveLastItem.Image");
			this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
			this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
			this.bindingNavigatorMoveLastItem.Size = new Size(23, 22);
			this.bindingNavigatorMoveLastItem.Text = "Move last";
			this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
			this.bindingNavigatorSeparator2.Size = new Size(6, 25);
			this.lblSpace.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.lblSpace.BackColor = Color.White;
			this.lblSpace.Location = new Point(-7, 561);
			this.lblSpace.Name = "lblSpace";
			this.lblSpace.Size = new Size(931, 38);
			this.lblSpace.TabIndex = 781;
			this.button1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.button1.BackColor = SystemColors.ControlLight;
			this.button1.Cursor = Cursors.Hand;
			this.button1.FlatAppearance.BorderColor = Color.FromArgb(255, 192, 255);
			this.button1.FlatStyle = FlatStyle.Flat;
			this.button1.Font = new Font("Arial", 9f, FontStyle.Bold, GraphicsUnit.Point, 163);
			this.button1.ImageAlign = ContentAlignment.MiddleLeft;
			this.button1.Location = new Point(329, 565);
			this.button1.Name = "button1";
			this.button1.Size = new Size(105, 30);
			this.button1.TabIndex = 782;
			this.button1.Text = "Báo cáo [ F7 ]";
			this.button1.UseVisualStyleBackColor = false;
			this.label1.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.label1.BackColor = Color.White;
			this.label1.Location = new Point(-7, 0);
			this.label1.Name = "label1";
			this.label1.Size = new Size(931, 54);
			this.label1.TabIndex = 783;
			this.dataGridViewTextBoxColumn1.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dataGridViewTextBoxColumn1.DataPropertyName = "P_Name";
			dataGridViewCellStyle3.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle3.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle3.NullValue = null;
			this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle3;
			this.dataGridViewTextBoxColumn1.HeaderText = "Tên sản phẩm";
			this.dataGridViewTextBoxColumn1.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
			this.dataGridViewTextBoxColumn1.ReadOnly = true;
			this.dataGridViewTextBoxColumn1.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn1.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn1.Visible = false;
			this.dataGridViewTextBoxColumn2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn2.DataPropertyName = "UnitName";
			dataGridViewCellStyle4.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle4.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle4.NullValue = null;
			this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle4;
			this.dataGridViewTextBoxColumn2.HeaderText = "Đơn vị tính";
			this.dataGridViewTextBoxColumn2.MinimumWidth = 120;
			this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
			this.dataGridViewTextBoxColumn2.ReadOnly = true;
			this.dataGridViewTextBoxColumn2.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn2.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.dataGridViewTextBoxColumn2.Width = 120;
			this.dataGridViewTextBoxColumn3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn3.DataPropertyName = "P_PriceBase";
			dataGridViewCellStyle5.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle5.Format = "###,0";
			this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle5;
			this.dataGridViewTextBoxColumn3.HeaderText = "Giá nhập";
			this.dataGridViewTextBoxColumn3.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
			this.dataGridViewTextBoxColumn3.ReadOnly = true;
			this.dataGridViewTextBoxColumn3.Width = 90;
			this.dataGridViewTextBoxColumn4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn4.DataPropertyName = "P_PriceTrade";
			dataGridViewCellStyle6.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle6.Format = "###,0";
			dataGridViewCellStyle6.NullValue = null;
			this.dataGridViewTextBoxColumn4.DefaultCellStyle = dataGridViewCellStyle6;
			this.dataGridViewTextBoxColumn4.HeaderText = "Giá bán buôn";
			this.dataGridViewTextBoxColumn4.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
			this.dataGridViewTextBoxColumn4.ReadOnly = true;
			this.dataGridViewTextBoxColumn4.Width = 90;
			this.dataGridViewTextBoxColumn5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn5.DataPropertyName = "P_PriceRetail";
			dataGridViewCellStyle7.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle7.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle7.Format = "###,0";
			this.dataGridViewTextBoxColumn5.DefaultCellStyle = dataGridViewCellStyle7;
			this.dataGridViewTextBoxColumn5.HeaderText = "Giá bán lẻ";
			this.dataGridViewTextBoxColumn5.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
			this.dataGridViewTextBoxColumn5.ReadOnly = true;
			this.dataGridViewTextBoxColumn5.Width = 90;
			this.dataGridViewTextBoxColumn6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn6.DataPropertyName = "PID";
			dataGridViewCellStyle8.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle8.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle8.Format = "###,0";
			this.dataGridViewTextBoxColumn6.DefaultCellStyle = dataGridViewCellStyle8;
			this.dataGridViewTextBoxColumn6.HeaderText = "PID";
			this.dataGridViewTextBoxColumn6.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
			this.dataGridViewTextBoxColumn6.ReadOnly = true;
			this.dataGridViewTextBoxColumn6.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn6.Visible = false;
			this.dataGridViewTextBoxColumn6.Width = 90;
			this.dataGridViewTextBoxColumn7.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn7.DataPropertyName = "MinBalance";
			dataGridViewCellStyle9.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle9.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle9.ForeColor = Color.Blue;
			this.dataGridViewTextBoxColumn7.DefaultCellStyle = dataGridViewCellStyle9;
			this.dataGridViewTextBoxColumn7.HeaderText = "Tồn tối thiểu";
			this.dataGridViewTextBoxColumn7.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
			this.dataGridViewTextBoxColumn7.ReadOnly = true;
			this.dataGridViewTextBoxColumn7.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn7.Visible = false;
			this.dataGridViewTextBoxColumn7.Width = 90;
			this.dataGridViewTextBoxColumn8.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn8.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle10.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle10.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle10.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle10;
			this.dataGridViewTextBoxColumn8.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn8.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
			this.dataGridViewTextBoxColumn8.ReadOnly = true;
			this.dataGridViewTextBoxColumn8.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn8.Visible = false;
			this.dataGridViewTextBoxColumn8.Width = 90;
			this.dataGridViewTextBoxColumn9.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn9.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle11.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle11.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle11.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn9.DefaultCellStyle = dataGridViewCellStyle11;
			this.dataGridViewTextBoxColumn9.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn9.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
			this.dataGridViewTextBoxColumn9.ReadOnly = true;
			this.dataGridViewTextBoxColumn9.Width = 90;
			this.dataGridViewTextBoxColumn10.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn10.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle12.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle12.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle12.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn10.DefaultCellStyle = dataGridViewCellStyle12;
			this.dataGridViewTextBoxColumn10.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn10.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
			this.dataGridViewTextBoxColumn10.ReadOnly = true;
			this.dataGridViewTextBoxColumn10.Width = 90;
			this.dataGridViewTextBoxColumn11.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn11.DataPropertyName = "P_PriceBase";
			dataGridViewCellStyle13.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle13.Format = "###,0";
			this.dataGridViewTextBoxColumn11.DefaultCellStyle = dataGridViewCellStyle13;
			this.dataGridViewTextBoxColumn11.HeaderText = "Giá nhập";
			this.dataGridViewTextBoxColumn11.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
			this.dataGridViewTextBoxColumn11.ReadOnly = true;
			this.dataGridViewTextBoxColumn11.Width = 90;
			this.dataGridViewTextBoxColumn12.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn12.DataPropertyName = "P_PriceTrade";
			dataGridViewCellStyle14.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle14.Format = "###,0";
			dataGridViewCellStyle14.NullValue = null;
			this.dataGridViewTextBoxColumn12.DefaultCellStyle = dataGridViewCellStyle14;
			this.dataGridViewTextBoxColumn12.HeaderText = "Giá bán buôn";
			this.dataGridViewTextBoxColumn12.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
			this.dataGridViewTextBoxColumn12.ReadOnly = true;
			this.dataGridViewTextBoxColumn12.Width = 90;
			this.dataGridViewTextBoxColumn13.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn13.DataPropertyName = "P_PriceRetail";
			dataGridViewCellStyle15.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle15.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle15.Format = "###,0";
			this.dataGridViewTextBoxColumn13.DefaultCellStyle = dataGridViewCellStyle15;
			this.dataGridViewTextBoxColumn13.HeaderText = "Giá bán lẻ";
			this.dataGridViewTextBoxColumn13.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
			this.dataGridViewTextBoxColumn13.ReadOnly = true;
			this.dataGridViewTextBoxColumn13.Width = 90;
			this.dataGridViewTextBoxColumn14.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn14.DataPropertyName = "PID";
			this.dataGridViewTextBoxColumn14.HeaderText = "PID";
			this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
			this.dataGridViewTextBoxColumn14.ReadOnly = true;
			this.dataGridViewTextBoxColumn14.Resizable = DataGridViewTriState.False;
			this.dataGridViewTextBoxColumn14.Visible = false;
			this.dataGridViewTextBoxColumn14.Width = 5;
			this.dataGridViewTextBoxColumn15.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn15.DataPropertyName = "MinBalance";
			dataGridViewCellStyle16.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle16.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle16.ForeColor = Color.Blue;
			this.dataGridViewTextBoxColumn15.DefaultCellStyle = dataGridViewCellStyle16;
			this.dataGridViewTextBoxColumn15.HeaderText = "Tồn tối thiểu";
			this.dataGridViewTextBoxColumn15.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
			this.dataGridViewTextBoxColumn15.ReadOnly = true;
			this.dataGridViewTextBoxColumn15.Width = 90;
			this.dataGridViewTextBoxColumn16.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dataGridViewTextBoxColumn16.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle17.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle17.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle17.ForeColor = Color.Red;
			this.dataGridViewTextBoxColumn16.DefaultCellStyle = dataGridViewCellStyle17;
			this.dataGridViewTextBoxColumn16.HeaderText = "Tồn tối đa";
			this.dataGridViewTextBoxColumn16.MinimumWidth = 90;
			this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16";
			this.dataGridViewTextBoxColumn16.ReadOnly = true;
			this.dataGridViewTextBoxColumn16.Width = 90;
			this.GpID.DataPropertyName = "GpID";
			this.GpID.HeaderText = "Column4";
			this.GpID.Name = "GpID";
			this.GpID.ReadOnly = true;
			this.GpID.Visible = false;
			this.GroupName.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.GroupName.DataPropertyName = "GroupName";
			dataGridViewCellStyle18.NullValue = "False";
			this.GroupName.DefaultCellStyle = dataGridViewCellStyle18;
			this.GroupName.HeaderText = "Nhóm sản phẩm";
			this.GroupName.MinimumWidth = 200;
			this.GroupName.Name = "GroupName";
			this.GroupName.ReadOnly = true;
			this.GroupName.Resizable = DataGridViewTriState.False;
			this.GroupName.SortMode = DataGridViewColumnSortMode.NotSortable;
			this.GroupName.Width = 200;
			this.dg2.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
			this.dg2.DataPropertyName = "P_Name";
			dataGridViewCellStyle19.Alignment = DataGridViewContentAlignment.MiddleLeft;
			dataGridViewCellStyle19.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle19.NullValue = null;
			this.dg2.DefaultCellStyle = dataGridViewCellStyle19;
			this.dg2.HeaderText = "Tên sản phẩm";
			this.dg2.MinimumWidth = 200;
			this.dg2.Name = "dg2";
			this.dg2.ReadOnly = true;
			this.Column1.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column1.DataPropertyName = "UnitName";
			this.Column1.HeaderText = "Đơn vị tính";
			this.Column1.MinimumWidth = 75;
			this.Column1.Name = "Column1";
			this.Column1.ReadOnly = true;
			this.Column1.Width = 75;
			this.Agent1.DataPropertyName = "Agent1";
			dataGridViewCellStyle20.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle20.Format = "N2";
			dataGridViewCellStyle20.NullValue = "0";
			this.Agent1.DefaultCellStyle = dataGridViewCellStyle20;
			this.Agent1.HeaderText = "NT - 1";
			this.Agent1.Name = "Agent1";
			this.Agent1.ReadOnly = true;
			this.Agent2.DataPropertyName = "Agent2";
			dataGridViewCellStyle21.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle21.Format = "N2";
			dataGridViewCellStyle21.NullValue = "0";
			this.Agent2.DefaultCellStyle = dataGridViewCellStyle21;
			this.Agent2.HeaderText = "NT - 2";
			this.Agent2.Name = "Agent2";
			this.Agent2.ReadOnly = true;
			this.Agent3.DataPropertyName = "Agent3";
			dataGridViewCellStyle22.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle22.Format = "N2";
			dataGridViewCellStyle22.NullValue = "0";
			this.Agent3.DefaultCellStyle = dataGridViewCellStyle22;
			this.Agent3.HeaderText = "NT - 3";
			this.Agent3.Name = "Agent3";
			this.Agent3.ReadOnly = true;
			this.RootPrice.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.RootPrice.DataPropertyName = "RootPrice";
			dataGridViewCellStyle23.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle23.Format = "N2";
			dataGridViewCellStyle23.NullValue = "0";
			this.RootPrice.DefaultCellStyle = dataGridViewCellStyle23;
			this.RootPrice.HeaderText = "Giá công ty";
			this.RootPrice.MinimumWidth = 80;
			this.RootPrice.Name = "RootPrice";
			this.RootPrice.ReadOnly = true;
			this.RootPrice.Width = 80;
			this.Discount.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Discount.DataPropertyName = "Discount";
			dataGridViewCellStyle24.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle24.Format = "N2";
			dataGridViewCellStyle24.NullValue = "0";
			this.Discount.DefaultCellStyle = dataGridViewCellStyle24;
			this.Discount.HeaderText = "% Chiết khấu";
			this.Discount.MinimumWidth = 90;
			this.Discount.Name = "Discount";
			this.Discount.ReadOnly = true;
			this.Discount.Width = 90;
			this.DiscountPrice.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.DiscountPrice.DataPropertyName = "DiscountPrice";
			dataGridViewCellStyle25.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle25.Format = "N2";
			dataGridViewCellStyle25.NullValue = "0";
			this.DiscountPrice.DefaultCellStyle = dataGridViewCellStyle25;
			this.DiscountPrice.HeaderText = "Giá sau chiết khấu";
			this.DiscountPrice.MinimumWidth = 120;
			this.DiscountPrice.Name = "DiscountPrice";
			this.DiscountPrice.ReadOnly = true;
			this.DiscountPrice.Width = 120;
			this.dg3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg3.DataPropertyName = "P_PriceBase";
			dataGridViewCellStyle26.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle26.Format = "###,0";
			this.dg3.DefaultCellStyle = dataGridViewCellStyle26;
			this.dg3.HeaderText = "Giá nhập";
			this.dg3.MinimumWidth = 90;
			this.dg3.Name = "dg3";
			this.dg3.ReadOnly = true;
			this.dg3.Width = 90;
			this.dg4.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg4.DataPropertyName = "P_PriceTrade";
			dataGridViewCellStyle27.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle27.Format = "###,0";
			dataGridViewCellStyle27.NullValue = null;
			this.dg4.DefaultCellStyle = dataGridViewCellStyle27;
			this.dg4.HeaderText = "Giá bán buôn";
			this.dg4.MinimumWidth = 90;
			this.dg4.Name = "dg4";
			this.dg4.ReadOnly = true;
			this.dg4.Width = 90;
			this.dg5.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg5.DataPropertyName = "P_PriceRetail";
			dataGridViewCellStyle28.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle28.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle28.Format = "###,0";
			this.dg5.DefaultCellStyle = dataGridViewCellStyle28;
			this.dg5.HeaderText = "Giá bán lẻ";
			this.dg5.MinimumWidth = 90;
			this.dg5.Name = "dg5";
			this.dg5.ReadOnly = true;
			this.dg5.Width = 90;
			this.dg6.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.dg6.DataPropertyName = "PID";
			this.dg6.HeaderText = "PID";
			this.dg6.Name = "dg6";
			this.dg6.ReadOnly = true;
			this.dg6.Resizable = DataGridViewTriState.False;
			this.dg6.Visible = false;
			this.dg6.Width = 5;
			this.Column2.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column2.DataPropertyName = "MinBalance";
			dataGridViewCellStyle29.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle29.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle29.ForeColor = Color.Blue;
			this.Column2.DefaultCellStyle = dataGridViewCellStyle29;
			this.Column2.HeaderText = "Tồn tối thiểu";
			this.Column2.MinimumWidth = 90;
			this.Column2.Name = "Column2";
			this.Column2.ReadOnly = true;
			this.Column2.Width = 90;
			this.Column3.AutoSizeMode = DataGridViewAutoSizeColumnMode.None;
			this.Column3.DataPropertyName = "MaxBalance";
			dataGridViewCellStyle30.Alignment = DataGridViewContentAlignment.MiddleRight;
			dataGridViewCellStyle30.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			dataGridViewCellStyle30.ForeColor = Color.Red;
			this.Column3.DefaultCellStyle = dataGridViewCellStyle30;
			this.Column3.HeaderText = "Tồn tối đa";
			this.Column3.MinimumWidth = 90;
			this.Column3.Name = "Column3";
			this.Column3.ReadOnly = true;
			this.Column3.Width = 90;
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			this.BackgroundImageLayout = ImageLayout.Stretch;
			base.ClientSize = new Size(900, 600);
			base.Controls.Add(this.button1);
			base.Controls.Add(this.bindingNavigator1);
			base.Controls.Add(this.txtSearch);
			base.Controls.Add(this.label2);
			base.Controls.Add(this.cbbList);
			base.Controls.Add(this.dgvRep);
			base.Controls.Add(this.label9);
			base.Controls.Add(this.tSBClose);
			base.Controls.Add(this.btnDel);
			base.Controls.Add(this.tSBSave);
			base.Controls.Add(this.label7);
			base.Controls.Add(this.tSBAdd);
			base.Controls.Add(this.txtInputPrice);
			base.Controls.Add(this.txtreTailPrice);
			base.Controls.Add(this.label8);
			base.Controls.Add(this.txtSalePrice);
			base.Controls.Add(this.lblSpace);
			base.Controls.Add(this.label1);
			base.Controls.Add(this.btnShowAll);
			this.DoubleBuffered = true;
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (System.Drawing.Icon)componentResourceManager.GetObject("$this.Icon");
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.MaximizeBox = false;
			base.MinimizeBox = false;
			this.MinimumSize = new Size(900, 600);
			base.Name = "frmBookProduct";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "THUỐC VẬT TƯ";
			base.Load += new EventHandler(this.FrmupdtProduct_Load);
			base.Shown += new EventHandler(this.FrmupdtProduct_Shown);
			base.KeyDown += new KeyEventHandler(this.FrmupdtProduct_KeyDown);
			((ISupportInitialize)this.dgvRep).EndInit();
			((ISupportInitialize)this.bindingNavigator1).EndInit();
			this.bindingNavigator1.ResumeLayout(false);
			this.bindingNavigator1.PerformLayout();
			base.ResumeLayout(false);
			base.PerformLayout();
		}
		public frmBookProduct()
		{
			this.InitializeComponent();
		}
		private void tSBClose_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private void FrmupdtProduct_Load(object sender, EventArgs e)
		{
			try
			{
				this.cbbList.SelectedIndex = 1;
			}
			catch
			{
			}
			this.loaded = true;
		}
		public void getGroupProduct()
		{
			int num = 1;
			this.objTable = new DataTable();
			DataColumn column = new DataColumn("GpID", typeof(string));
			DataColumn column2 = new DataColumn("GroupName", typeof(string));
			DataColumn column3 = new DataColumn("PID", typeof(string));
			DataColumn column4 = new DataColumn("P_Name", typeof(string));
			DataColumn column5 = new DataColumn("P_PriceBase", typeof(string));
			DataColumn column6 = new DataColumn("P_PriceTrade", typeof(string));
			DataColumn column7 = new DataColumn("P_PriceRetail", typeof(string));
			DataColumn column8 = new DataColumn("UnitName", typeof(string));
			DataColumn column9 = new DataColumn("Agent1", typeof(string));
			DataColumn column10 = new DataColumn("Agent2", typeof(string));
			DataColumn column11 = new DataColumn("Agent3", typeof(string));
			DataColumn column12 = new DataColumn("RootPrice", typeof(string));
			DataColumn column13 = new DataColumn("Discount", typeof(string));
			DataColumn column14 = new DataColumn("DiscountPrice", typeof(string));
			DataColumn column15 = new DataColumn("MinBalance", typeof(string));
			DataColumn column16 = new DataColumn("MaxBalance", typeof(string));
			this.objTable.Columns.Add(column);
			this.objTable.Columns.Add(column2);
			this.objTable.Columns.Add(column3);
			this.objTable.Columns.Add(column4);
			this.objTable.Columns.Add(column5);
			this.objTable.Columns.Add(column6);
			this.objTable.Columns.Add(column7);
			this.objTable.Columns.Add(column8);
			this.objTable.Columns.Add(column9);
			this.objTable.Columns.Add(column10);
			this.objTable.Columns.Add(column11);
			this.objTable.Columns.Add(column12);
			this.objTable.Columns.Add(column13);
			this.objTable.Columns.Add(column14);
			this.objTable.Columns.Add(column15);
			this.objTable.Columns.Add(column16);
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			string text;
			if (this.currGroup == 0)
			{
				text = "";
			}
			else
			{
				text = " AND GpID = " + this.currGroup;
			}
			string text2;
			if (this.txtSearch.Text != "")
			{
				text2 = string.Concat(new string[]
				{
					" AND (Upper(TabProductsExt.P_Name) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' OR Upper(TabProductsExt.NameSearch) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' ) "
				});
			}
			else
			{
				text2 = " ";
			}
			string cmdText;
			if (this.cbbList.SelectedIndex == 0)
			{
				cmdText = string.Concat(new string[]
				{
					"SELECT GpID, GpName FROM TabGProducts WHERE gpID IN (SELECT GpID FROM TabProductsExt WHERE 1 = 1 ",
					text2,
					") ",
					text,
					" ORDER By GpName"
				});
			}
			else
			{
				cmdText = string.Concat(new string[]
				{
					"SELECT GpID, GpName FROM TabGProducts WHERE gpID IN (SELECT GpID FROM TabProductsExt WHERE SUBSTRING([TabProductsExt].[P_name], 1, 1) = '",
					this.cbbList.Text.Replace("------ ", ""),
					"') ",
					text,
					" ORDER By GpName"
				});
			}
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			while (sqlDataReader.Read())
			{
				this.objTable.Rows.Add(new object[]
				{
					sqlDataReader["GpID"].ToString(),
					num.ToString() + " - " + sqlDataReader["GpName"].ToString(),
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					"",
					""
				});
				this.getProducts(sqlDataReader["GpID"].ToString(), sqlDataReader["GpName"].ToString());
				num++;
			}
			sqlDataReader.Close();
			sqlConnection.Close();
			sqlConnection.Dispose();
			BindingSource bindingSource = new BindingSource();
			bindingSource.DataSource = this.objTable;
			this.bindingNavigator1.BindingSource = bindingSource;
			this.dgvRep.DataSource = bindingSource;
			this.dgvRep.Columns["Agent1"].HeaderText = this.objP.getAgentName("Agent1");
			this.dgvRep.Columns["Agent1"].Width = this.dgvRep.Columns["Agent1"].HeaderText.Trim().Length * 7;
			this.dgvRep.Columns["Agent2"].HeaderText = this.objP.getAgentName("Agent2");
			this.dgvRep.Columns["Agent2"].Width = this.dgvRep.Columns["Agent2"].HeaderText.Trim().Length * 7;
			this.dgvRep.Columns["Agent3"].HeaderText = this.objP.getAgentName("Agent3");
			this.dgvRep.Columns["Agent3"].Width = this.dgvRep.Columns["Agent3"].HeaderText.Trim().Length * 7;
		}
		public void getProducts(string GpID, string GpName)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			string str;
			if (this.txtSearch.Text != "")
			{
				str = string.Concat(new string[]
				{
					" AND (Upper(TabProductsExt.P_Name) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' OR Upper(TabProductsExt.NameSearch) LIKE N'%",
					this.txtSearch.Text.ToUpper(),
					"%' ) "
				});
			}
			else
			{
				str = " ";
			}
			string cmdText;
			if (this.cbbList.SelectedIndex == 0)
			{
				cmdText = "SELECT TOP 100 PID,P_Name,P_PriceBase,P_PriceTrade,P_PriceRetail,UPPER(UnitName) AS UnitName, MinBalance, MaxBalance, ISNULL(Agent1, 0) AS Agent1, ISNULL(Agent2,0) AS Agent2, ISNULL(Agent3,0) AS Agent3, ISNULL(RootPrice,0) AS RootPrice, ISNULL(Discount,0) AS Discount, ISNULL(DiscountPrice,0) AS DiscountPrice FROM [TabProductsExt],[TabUnitProduct] WHERE [TabProductsExt].[P_DonViTinh] = [TabUnitProduct].[UnitID] AND [GpID] = " + GpID + str + " ORDER BY [P_Name]";
			}
			else
			{
				cmdText = string.Concat(new string[]
				{
					"SELECT TOP 100 PID,P_Name,P_PriceBase,P_PriceTrade,P_PriceRetail,UPPER(UnitName) AS UnitName, MinBalance, MaxBalance, ISNULL(Agent1, 0) AS Agent1, ISNULL(Agent2,0) AS Agent2, ISNULL(Agent3,0) AS Agent3, ISNULL(RootPrice,0) AS RootPrice, ISNULL(Discount,0) AS Discount, ISNULL(DiscountPrice,0) AS DiscountPrice FROM [TabProductsExt],[TabUnitProduct] WHERE SUBSTRING([TabProductsExt].[P_name], 1, 1) = '",
					this.cbbList.Text.Replace("------ ", ""),
					"' AND [TabProductsExt].[P_DonViTinh] = [TabUnitProduct].[UnitID] AND [GpID] = ",
					GpID,
					" ORDER BY [P_Name]"
				});
			}
			SqlCommand sqlCommand = new SqlCommand(cmdText, sqlConnection);
			SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
			while (sqlDataReader.Read())
			{
				this.objTable.Rows.Add(new object[]
				{
					"",
					"",
					sqlDataReader["PID"].ToString(),
					sqlDataReader["P_Name"].ToString(),
					sqlDataReader["P_PriceBase"].ToString(),
					sqlDataReader["P_PriceTrade"].ToString(),
					sqlDataReader["P_PriceRetail"].ToString(),
					sqlDataReader["UnitName"].ToString(),
					sqlDataReader["Agent1"].ToString(),
					sqlDataReader["Agent2"].ToString(),
					sqlDataReader["Agent3"].ToString(),
					sqlDataReader["RootPrice"].ToString(),
					sqlDataReader["Discount"].ToString(),
					sqlDataReader["DiscountPrice"].ToString(),
					sqlDataReader["MinBalance"].ToString(),
					sqlDataReader["MaxBalance"].ToString()
				});
			}
			sqlConnection.Close();
			sqlConnection.Dispose();
		}
		private void InsertProductFirst(int tmpID, string tmpName)
		{
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			SqlConnection sqlConnection2 = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			SqlCommand sqlCommand = new SqlCommand("InsertProductToWareProduct", sqlConnection);
			sqlCommand.CommandType = CommandType.StoredProcedure;
			sqlCommand.Parameters.Add("@whID", SqlDbType.VarChar, 50);
			sqlCommand.Parameters.Add("@pID", SqlDbType.Int);
			sqlCommand.Parameters.Add("@pName", SqlDbType.NVarChar, 300);
			sqlCommand.Parameters.Add("@Month", SqlDbType.SmallInt);
			sqlCommand.Parameters.Add("@Year", SqlDbType.Int);
			SqlCommand sqlCommand2 = new SqlCommand("SELECT DISTINCT WareHouse_ID FROM TabWareHouse ", sqlConnection2);
			sqlConnection2.Open();
			SqlDataReader sqlDataReader = sqlCommand2.ExecuteReader();
			if (sqlDataReader.HasRows)
			{
				while (sqlDataReader.Read())
				{
					sqlCommand.Parameters["@whID"].Value = sqlDataReader["WareHouse_ID"].ToString();
					sqlCommand.Parameters["@pID"].Value = tmpID;
					sqlCommand.Parameters["@pName"].Value = tmpName;
					sqlCommand.Parameters["@Month"].Value = DateTime.Now.Month;
					sqlCommand.Parameters["@Year"].Value = DateTime.Now.Year;
					sqlCommand.ExecuteNonQuery();
				}
			}
			sqlDataReader.Close();
			sqlDataReader.Dispose();
			sqlConnection2.Close();
			sqlConnection.Close();
			sqlConnection2.Dispose();
			sqlConnection.Dispose();
		}
		private void txtInputPrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtSalePrice.Focus();
			}
		}
		private void txtSalePrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.txtreTailPrice.Focus();
			}
		}
		private void txtreTailPrice_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
			}
		}
		private string NameForSearch(string RealName)
		{
			RealName = RealName.ToLower();
			RealName = RealName.Replace("ư", "u").Replace("ứ", "u").Replace("ự", "u").Replace("ử", "u").Replace("ừ", "u").Replace("ữ", "u");
			RealName = RealName.Replace("ú", "u").Replace("ụ", "u").Replace("ủ", "u").Replace("ù", "u").Replace("ũ", "u");
			RealName = RealName.Replace("á", "a").Replace("ạ", "a").Replace("ả", "a").Replace("à", "a").Replace("ã", "a");
			RealName = RealName.Replace("â", "a").Replace("ấ", "a").Replace("ẩ", "a").Replace("ầ", "a").Replace("ậ", "a").Replace("ẫ", "a");
			RealName = RealName.Replace("ă", "a").Replace("ắ", "a").Replace("ẳ", "a").Replace("ằ", "a").Replace("ặ", "a").Replace("ẵ", "a");
			RealName = RealName.Replace("ê", "e").Replace("ế", "e").Replace("ể", "e").Replace("ề", "e").Replace("ệ", "e").Replace("ễ", "e");
			RealName = RealName.Replace("é", "e").Replace("ẹ", "e").Replace("ẻ", "e").Replace("è", "e").Replace("ẽ", "e");
			RealName = RealName.Replace("í", "i").Replace("ị", "i").Replace("ỉ", "i").Replace("ì", "i").Replace("ĩ", "i");
			RealName = RealName.Replace("ý", "y").Replace("ỵ", "y").Replace("ỷ", "y").Replace("ỳ", "y").Replace("ỹ", "y");
			RealName = RealName.Replace("ó", "o").Replace("ỏ", "o").Replace("ò", "o").Replace("ọ", "o").Replace("õ", "o");
			RealName = RealName.Replace("đ", "d");
			RealName = RealName.Replace("ơ", "o").Replace("ớ", "o").Replace("ở", "o").Replace("ờ", "o").Replace("ợ", "o").Replace("ỡ", "o");
			RealName = RealName.Replace("ô", "o").Replace("ố", "o").Replace("ổ", "o").Replace("ồ", "o").Replace("ộ", "o").Replace("ỗ", "o");
			return RealName;
		}
		private void txtSearchFor_KeyPress(object sender, KeyPressEventArgs e)
		{
		}
		private string CheckProductExistInRep(string Pid)
		{
			string result = "";
			SqlConnection sqlConnection = new SqlConnection(Program.strConnectionString);
			sqlConnection.Open();
			try
			{
				SqlCommand sqlCommand = sqlConnection.CreateCommand();
				sqlCommand.CommandText = "SELECT TOP 1 [BillID] FROM [TabDetailBill] WHERE [Pid]=" + Pid;
				SqlDataReader sqlDataReader = sqlCommand.ExecuteReader();
				while (sqlDataReader.Read())
				{
					result = sqlDataReader["BillID"].ToString();
				}
				sqlDataReader.Close();
				sqlDataReader.Dispose();
			}
			catch
			{
			}
			sqlConnection.Close();
			sqlConnection.Dispose();
			return result;
		}
		private void tSBSave_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				this.tSBAdd.PerformClick();
			}
		}
		private void FrmupdtProduct_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.F4)
			{
				this.tSBAdd.PerformClick();
			}
			else
			{
				if (e.KeyCode == Keys.F5)
				{
					this.tSBSave.PerformClick();
				}
				else
				{
					if (e.KeyCode == Keys.F6)
					{
						this.btnDel.PerformClick();
					}
					else
					{
						if (e.KeyCode == Keys.F7)
						{
							this.btnDel.PerformClick();
						}
						else
						{
							if (e.KeyCode == Keys.Escape)
							{
								base.Close();
							}
						}
					}
				}
			}
		}
		private void btnFastGroupProduct_Click(object sender, EventArgs e)
		{
			new FrmupdtGproduct
			{
				Size = new Size(500, 300),
				StartPosition = FormStartPosition.Manual,
				FormBorderStyle = FormBorderStyle.FixedToolWindow//,
				//StartPosition = FormStartPosition.CenterScreen
			}.ShowDialog();
		}
		private void cbbList_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.getGroupProduct();
		}
		private void txtSearch_TextChanged(object sender, EventArgs e)
		{
			if (this.loaded)
			{
				this.currGroup = 0;
				this.getGroupProduct();
			}
		}
		private void btnShowAll_Click(object sender, EventArgs e)
		{
			this.txtSearch.Text = "";
			this.getGroupProduct();
		}
		private void txtSearch_Enter(object sender, EventArgs e)
		{
			this.cbbList.SelectedIndex = 0;
		}
		private void mnuShowOne_Click(object sender, EventArgs e)
		{
			this.getGroupProduct();
		}
		private void mnuShowAll_Click(object sender, EventArgs e)
		{
			this.currGroup = 0;
			this.getGroupProduct();
		}
		private void FrmupdtProduct_Shown(object sender, EventArgs e)
		{
			if (this.dgvRep.Rows.Count == 0)
			{
				this.btnShowAll.PerformClick();
			}
		}
		private void tSBAdd_Click(object sender, EventArgs e)
		{
			this.objP.syncProductExt();
		}
		private void tSBSave_Click(object sender, EventArgs e)
		{
			this.dgvRep.ReadOnly = false;
		}
		private void btnDel_Click(object sender, EventArgs e)
		{
			this.objP.syncProductExt(this.dgvRep);
			this.btnShowAll.PerformClick();
			MessageBox.Show("Dữ liệu đã được cập nhật vào hệ thống !", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			this.dgvRep.ReadOnly = true;
		}
	}
}
